package com.cmf.dto;

import com.cmf.enums.Gender;
import com.cmf.utils.RegexUtils;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.*;

/**
 * @Author: cmf
 * @Date: 2025/8/28 15:18
 * @Version: v1.0.0
 * @Description: 员工新增参数
 **/
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class EmployeeDto {



    @NotBlank(message = "用户名不能为空")
    @Size(min = 3, max = 20, message = "用户名长度必须在2-20之间")
    private String username;


    @NotNull(message = "性别不能为空")
    @Min(value = 0, message = "性别值不合法")
    @Max(value = 2, message = "性别值不合法")
    private Integer sex;

    @NotBlank(message = "手机号不能为空")
    @Size(min = 11, max = 11, message = "手机号长度必须为11位")
    @Pattern(regexp = RegexUtils.MOBILE_PHONE_REGEX, message = "手机号格式不正确")
    private String phone;

    @NotBlank(message = "姓名不能为空")
    @Size(min = 2, max = 20, message = "姓名长度必须在2-20之间")
    private String name;

    @NotBlank(message = "身份证号不能为空")
    @Size(min = 18, max = 18, message = "身份证号长度必须为18位")
    @Pattern(regexp = RegexUtils.ID_CARD_REGEX, message = "身份证号格式不正确")
    private String idNumber;

}
